<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMONS-NET: commonsNet.DatagramSocketClient类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">COMMONS-NET
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classcommonsNet_1_1DatagramSocketClient.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pro-methods">Protected 成员函数</a> &#124;
<a href="#pro-attribs">Protected 属性</a> &#124;
<a href="#pri-attribs">Private 属性</a> &#124;
<a href="classcommonsNet_1_1DatagramSocketClient-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">commonsNet.DatagramSocketClient类 参考</div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 commonsNet.DatagramSocketClient 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classcommonsNet_1_1DatagramSocketClient.png" usemap="#commonsNet.DatagramSocketClient_map" alt=""/>
  <map id="commonsNet.DatagramSocketClient_map" name="commonsNet.DatagramSocketClient_map">
<area href="classcommonsNet_1_1chargen_1_1CharGenUDPClient.html" title="CharGenUDPClient类是RFC 864中描述的字符生成器协议的客户端的UDP实现。" alt="commonsNet.chargen.CharGenUDPClient" shape="rect" coords="0,56,246,80"/>
<area href="classcommonsNet_1_1daytime_1_1DaytimeUDPClient.html" title="DaytimeUDPClient 类是 Daytime 协议（在 RFC 867 中描述）的 UDP 客户端实现。" alt="commonsNet.daytime.DaytimeUDPClient" shape="rect" coords="256,56,502,80"/>
<area href="classcommonsNet_1_1discard_1_1DiscardUDPClient.html" title="DiscardUDPClient 类是实现了 RFC 863 中描述的 Discard 协议的 UDP 客户端。" alt="commonsNet.discard.DiscardUDPClient" shape="rect" coords="512,56,758,80"/>
<area href="classcommonsNet_1_1ntp_1_1NTPUDPClient.html" title="NTPUDPClient 类是基于UDP协议的 Network Time Protocol (NTP) 客户端实现， 符合 RFC 1305 描述的 NT P协议以及 RFC-2030 描述的简单网络时..." alt="commonsNet.ntp.NTPUDPClient" shape="rect" coords="768,56,1014,80"/>
<area href="classcommonsNet_1_1tftp_1_1TFTP.html" title="TFTP 类提供了直接与 TFTP（Trivial File Transfer Protocol）协议交互的方法。它扩展了 DatagramSocketClient 。" alt="commonsNet.tftp.TFTP" shape="rect" coords="1024,56,1270,80"/>
<area href="classcommonsNet_1_1time_1_1TimeUDPClient.html" title="TimeUDPClient 类是一个实现了 RFC 868 时间协议的 UDP 客户端。" alt="commonsNet.time.TimeUDPClient" shape="rect" coords="1280,56,1526,80"/>
<area href="classcommonsNet_1_1echo_1_1EchoUDPClient.html" title="EchoUDPClient 类是实现了 RFC 862 中描述的 Echo 协议的 UDP 客户端。" alt="commonsNet.echo.EchoUDPClient" shape="rect" coords="512,112,758,136"/>
<area href="classcommonsNet_1_1tftp_1_1TFTPClient.html" title="TFTPClient类封装了通过 TFTP 接收和发送文件所需的所有 TFTP 协议方面的细节。" alt="commonsNet.tftp.TFTPClient" shape="rect" coords="1024,112,1270,136"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a9bebd92e7988ee9c12dbcf538f236868"><td class="memItemLeft" align="right" valign="top">public&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a9bebd92e7988ee9c12dbcf538f236868">init</a> ()</td></tr>
<tr class="memdesc:a9bebd92e7988ee9c12dbcf538f236868"><td class="mdescLeft">&#160;</td><td class="mdescRight">无参构造函数 <em>socket</em>=None; <em>timeout</em>=0; <em>isOpen</em>=false; <em>socketFactory</em>= DEFAULT_SOCKET_FACTORY;  <br /></td></tr>
<tr class="separator:a9bebd92e7988ee9c12dbcf538f236868"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a94deac969cd5a4cea9634d9195d658"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a0a94deac969cd5a4cea9634d9195d658">receiveTimeout</a> : ?Duration</td></tr>
<tr class="memdesc:a0a94deac969cd5a4cea9634d9195d658"><td class="mdescLeft">&#160;</td><td class="mdescRight">属性readTimeout，用于设置和获取readTimeout  <br /></td></tr>
<tr class="separator:a0a94deac969cd5a4cea9634d9195d658"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac91a43c12fc616a881e49a3764364f2d"><td class="memItemLeft" align="right" valign="top">public mut prop&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac91a43c12fc616a881e49a3764364f2d">sendTimeout</a> : ?Duration</td></tr>
<tr class="memdesc:ac91a43c12fc616a881e49a3764364f2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">属性sendTimeout，用于设置和获取sendTimeout  <br /></td></tr>
<tr class="separator:ac91a43c12fc616a881e49a3764364f2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a95f9d80f21489bb3eb1c251d30b8aeaf"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a95f9d80f21489bb3eb1c251d30b8aeaf">close</a> ()</td></tr>
<tr class="memdesc:a95f9d80f21489bb3eb1c251d30b8aeaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于关闭套接字  <br /></td></tr>
<tr class="separator:a95f9d80f21489bb3eb1c251d30b8aeaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8568072f87aa0cc170d01eeea0d4274b"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a8568072f87aa0cc170d01eeea0d4274b">getDefaultTimeout</a> (): Int64</td></tr>
<tr class="memdesc:a8568072f87aa0cc170d01eeea0d4274b"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取打开套接字时使用的默认超时（以毫秒为单位）  <br /></td></tr>
<tr class="separator:a8568072f87aa0cc170d01eeea0d4274b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafdf43214202f97695ffe50f8e77c3f6"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aafdf43214202f97695ffe50f8e77c3f6">getLocalAddress</a> (): Array&lt;UInt8&gt;</td></tr>
<tr class="memdesc:aafdf43214202f97695ffe50f8e77c3f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取客户端的套接字绑定到的本地地址。  <br /></td></tr>
<tr class="separator:aafdf43214202f97695ffe50f8e77c3f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec74781fb202de91341c1151836dce88"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aec74781fb202de91341c1151836dce88">getLocalPort</a> (): UInt16</td></tr>
<tr class="memdesc:aec74781fb202de91341c1151836dce88"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取本地主机上打开的用于连接的套接字的端口号。  <br /></td></tr>
<tr class="separator:aec74781fb202de91341c1151836dce88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a537cb7e36f353ef171bc5477cf12d14c"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a537cb7e36f353ef171bc5477cf12d14c">isOpen</a> (): Bool</td></tr>
<tr class="memdesc:a537cb7e36f353ef171bc5477cf12d14c"><td class="mdescLeft">&#160;</td><td class="mdescRight">如果客户端具有当前打开的套接字，则为 true。  <br /></td></tr>
<tr class="separator:a537cb7e36f353ef171bc5477cf12d14c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac49b33247f17bf47dd062d1e68d7cb24"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac49b33247f17bf47dd062d1e68d7cb24">open</a> ()</td></tr>
<tr class="memdesc:ac49b33247f17bf47dd062d1e68d7cb24"><td class="mdescLeft">&#160;</td><td class="mdescRight">在本地主机上的第一个可用端口处打开 DatagramSocket。  <br /></td></tr>
<tr class="separator:ac49b33247f17bf47dd062d1e68d7cb24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfe0264b2b558712ef0605bbe6e6d805"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#acfe0264b2b558712ef0605bbe6e6d805">open</a> (port: UInt16)</td></tr>
<tr class="memdesc:acfe0264b2b558712ef0605bbe6e6d805"><td class="mdescLeft">&#160;</td><td class="mdescRight">在本地主机上的指定端口处打开 DatagramSocket  <br /></td></tr>
<tr class="separator:acfe0264b2b558712ef0605bbe6e6d805"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc3da28ec94b12365a60e0a8e0273409"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#afc3da28ec94b12365a60e0a8e0273409">open</a> (IPSocketAddress: IPSocketAddress)</td></tr>
<tr class="memdesc:afc3da28ec94b12365a60e0a8e0273409"><td class="mdescLeft">&#160;</td><td class="mdescRight">在指定端口的本地主机上的指定地址处打开 DatagramSocket  <br /></td></tr>
<tr class="separator:afc3da28ec94b12365a60e0a8e0273409"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07f62c0c51a3d53142f08bc13d447ca0"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a07f62c0c51a3d53142f08bc13d447ca0">setDatagramSocketFactory</a> (factory: ?<a class="el" href="interfacecommonsNet_1_1DatagramSocketFactory.html">DatagramSocketFactory</a>)</td></tr>
<tr class="memdesc:a07f62c0c51a3d53142f08bc13d447ca0"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置DatagramSocketClient使用的DatagramSocketFactory来打开DatagramSockets  <br /></td></tr>
<tr class="separator:a07f62c0c51a3d53142f08bc13d447ca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2986e7ad450928ce89e35b38ec539fd8"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a2986e7ad450928ce89e35b38ec539fd8">setDefaultTimeout</a> (timeout: Duration)</td></tr>
<tr class="memdesc:a2986e7ad450928ce89e35b38ec539fd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置打开套接字时使用的默认超时  <br /></td></tr>
<tr class="separator:a2986e7ad450928ce89e35b38ec539fd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7c800ada59a901f353dab58758525d6"><td class="memItemLeft" align="right" valign="top">public func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aa7c800ada59a901f353dab58758525d6">setDefaultTimeout</a> (timeout: Int64)</td></tr>
<tr class="memdesc:aa7c800ada59a901f353dab58758525d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置打开套接字时使用的默认超时  <br /></td></tr>
<tr class="separator:aa7c800ada59a901f353dab58758525d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected 成员函数</h2></td></tr>
<tr class="memitem:a7060e4aa1d53b57b837bfc280eaa9daf"><td class="memItemLeft" align="right" valign="top">protected func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a7060e4aa1d53b57b837bfc280eaa9daf">checkOpen</a> (): UdpSocket</td></tr>
<tr class="memdesc:a7060e4aa1d53b57b837bfc280eaa9daf"><td class="mdescLeft">&#160;</td><td class="mdescRight">得到非空的UdpSocket或者抛出异常  <br /></td></tr>
<tr class="separator:a7060e4aa1d53b57b837bfc280eaa9daf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-attribs" name="pro-attribs"></a>
Protected 属性</h2></td></tr>
<tr class="memitem:ac1d6e58d6682ffe35a5d1ddd767f747b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac1d6e58d6682ffe35a5d1ddd767f747b">var _timeout_</a> : Int64</td></tr>
<tr class="memdesc:ac1d6e58d6682ffe35a5d1ddd767f747b"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认超时  <br /></td></tr>
<tr class="separator:ac1d6e58d6682ffe35a5d1ddd767f747b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae817188cccd266d039b791da4f839c4d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ae817188cccd266d039b791da4f839c4d">var _socket_</a> : ?UdpSocket</td></tr>
<tr class="memdesc:ae817188cccd266d039b791da4f839c4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">用于连接的数据报套接字  <br /></td></tr>
<tr class="separator:ae817188cccd266d039b791da4f839c4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81cba3257050238fc73f20aadceb4d69"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#a81cba3257050238fc73f20aadceb4d69">var _isOpen_</a> : Bool</td></tr>
<tr class="memdesc:a81cba3257050238fc73f20aadceb4d69"><td class="mdescLeft">&#160;</td><td class="mdescRight">客户端的套接字当前是否处于打开状态  <br /></td></tr>
<tr class="separator:a81cba3257050238fc73f20aadceb4d69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae67ef3bfdd385af99f91c034e941bcc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#aae67ef3bfdd385af99f91c034e941bcc">var _socketFactory_</a> : <a class="el" href="interfacecommonsNet_1_1DatagramSocketFactory.html">DatagramSocketFactory</a></td></tr>
<tr class="memdesc:aae67ef3bfdd385af99f91c034e941bcc"><td class="mdescLeft">&#160;</td><td class="mdescRight">数据报套接字的 DatagramSocketFactory  <br /></td></tr>
<tr class="separator:aae67ef3bfdd385af99f91c034e941bcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pri-attribs" name="pri-attribs"></a>
Private 属性</h2></td></tr>
<tr class="memitem:ac0d2608b3cf17c8a8197a398b349b5b4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html#ac0d2608b3cf17c8a8197a398b349b5b4">static let DEFAULT_SOCKET_FACTORY</a> : <a class="el" href="classcommonsNet_1_1DefaultDatagramSocketFactory.html">DefaultDatagramSocketFactory</a> = DefaultDatagramSocketFactory.DEFAULT;</td></tr>
<tr class="separator:ac0d2608b3cf17c8a8197a398b349b5b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">构造及析构函数说明</h2>
<a id="a9bebd92e7988ee9c12dbcf538f236868" name="a9bebd92e7988ee9c12dbcf538f236868"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9bebd92e7988ee9c12dbcf538f236868">&#9670;&#160;</a></span>init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public commonsNet.DatagramSocketClient.init </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>无参构造函数 <em>socket</em>=None; <em>timeout</em>=0; <em>isOpen</em>=false; <em>socketFactory</em>= DEFAULT_SOCKET_FACTORY; </p>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a7060e4aa1d53b57b837bfc280eaa9daf" name="a7060e4aa1d53b57b837bfc280eaa9daf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7060e4aa1d53b57b837bfc280eaa9daf">&#9670;&#160;</a></span>checkOpen()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">protected func commonsNet.DatagramSocketClient.checkOpen </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: UdpSocket </td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>得到非空的UdpSocket或者抛出异常 </p>

</div>
</div>
<a id="a95f9d80f21489bb3eb1c251d30b8aeaf" name="a95f9d80f21489bb3eb1c251d30b8aeaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a95f9d80f21489bb3eb1c251d30b8aeaf">&#9670;&#160;</a></span>close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.close </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>用于关闭套接字 </p>
<p>应该在类实例使用完后以及再次调用<code><a class="el" href="">open（） </a></code> 之前调用此方法 <em>isOpen</em> 设置为false <em>socket</em> 设置为none </p>

</div>
</div>
<a id="a8568072f87aa0cc170d01eeea0d4274b" name="a8568072f87aa0cc170d01eeea0d4274b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8568072f87aa0cc170d01eeea0d4274b">&#9670;&#160;</a></span>getDefaultTimeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.getDefaultTimeout </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取打开套接字时使用的默认超时（以毫秒为单位） </p>

</div>
</div>
<a id="aafdf43214202f97695ffe50f8e77c3f6" name="aafdf43214202f97695ffe50f8e77c3f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafdf43214202f97695ffe50f8e77c3f6">&#9670;&#160;</a></span>getLocalAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.getLocalAddress </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Array&lt;UInt8&gt; </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取客户端的套接字绑定到的本地地址。 </p>
<p>如果在客户端套接字未打开时调用此方法抛出异常 </p>

</div>
</div>
<a id="aec74781fb202de91341c1151836dce88" name="aec74781fb202de91341c1151836dce88"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec74781fb202de91341c1151836dce88">&#9670;&#160;</a></span>getLocalPort()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.getLocalPort </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: UInt16 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取本地主机上打开的用于连接的套接字的端口号。 </p>
<p>如果在客户端套接字未打开时调用此方法，则抛出异常 </p>

</div>
</div>
<a id="a537cb7e36f353ef171bc5477cf12d14c" name="a537cb7e36f353ef171bc5477cf12d14c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a537cb7e36f353ef171bc5477cf12d14c">&#9670;&#160;</a></span>isOpen()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.isOpen </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td>: Bool </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>如果客户端具有当前打开的套接字，则为 true。 </p>

</div>
</div>
<a id="ac49b33247f17bf47dd062d1e68d7cb24" name="ac49b33247f17bf47dd062d1e68d7cb24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac49b33247f17bf47dd062d1e68d7cb24">&#9670;&#160;</a></span>open() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.open </td>
          <td>(</td>
          <td class="paramtype"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在本地主机上的第一个可用端口处打开 DatagramSocket。 </p>
<p><em>socket</em> 设置为新打开的套接字,Udpsocket需要调用bind()绑定 <em>isOpen</em> 设置为 true，receiveTimeout和sendTimeout设置为默认超时 </p>

</div>
</div>
<a id="afc3da28ec94b12365a60e0a8e0273409" name="afc3da28ec94b12365a60e0a8e0273409"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afc3da28ec94b12365a60e0a8e0273409">&#9670;&#160;</a></span>open() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.open </td>
          <td>(</td>
          <td class="paramname"><em>IPSocketAddress</em>:&#160;</td>
          <td class="paramtype">IPSocketAddress</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在指定端口的本地主机上的指定地址处打开 DatagramSocket </p>
<p><em>socket</em> 设置为新打开的套接字,Udpsocket需要调用bind()绑定 <em>isOpen</em> 设置为 true，receiveTimeout和sendTimeout设置为默认超时 </p>

</div>
</div>
<a id="acfe0264b2b558712ef0605bbe6e6d805" name="acfe0264b2b558712ef0605bbe6e6d805"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acfe0264b2b558712ef0605bbe6e6d805">&#9670;&#160;</a></span>open() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.open </td>
          <td>(</td>
          <td class="paramname"><em>port</em>:&#160;</td>
          <td class="paramtype">UInt16</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在本地主机上的指定端口处打开 DatagramSocket </p>
<p><em>socket</em> 设置为新打开的套接字,Udpsocket需要调用bind()绑定 <em>isOpen</em> 设置为 true，receiveTimeout和sendTimeout设置为默认超时 </p>

</div>
</div>
<a id="a0a94deac969cd5a4cea9634d9195d658" name="a0a94deac969cd5a4cea9634d9195d658"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a94deac969cd5a4cea9634d9195d658">&#9670;&#160;</a></span>receiveTimeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public mut prop commonsNet.DatagramSocketClient.receiveTimeout</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>属性readTimeout，用于设置和获取readTimeout </p>

</div>
</div>
<a id="ac91a43c12fc616a881e49a3764364f2d" name="ac91a43c12fc616a881e49a3764364f2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac91a43c12fc616a881e49a3764364f2d">&#9670;&#160;</a></span>sendTimeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public mut prop commonsNet.DatagramSocketClient.sendTimeout</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>属性sendTimeout，用于设置和获取sendTimeout </p>

</div>
</div>
<a id="a07f62c0c51a3d53142f08bc13d447ca0" name="a07f62c0c51a3d53142f08bc13d447ca0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07f62c0c51a3d53142f08bc13d447ca0">&#9670;&#160;</a></span>setDatagramSocketFactory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.setDatagramSocketFactory </td>
          <td>(</td>
          <td class="paramname"><em>factory</em>:&#160;</td>
          <td class="paramtype">?DatagramSocketFactory</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置DatagramSocketClient使用的DatagramSocketFactory来打开DatagramSockets </p>
<p>如果DatagramSocketFactory为none,则使用默认的DatagramSocketFactory </p>

</div>
</div>
<a id="a2986e7ad450928ce89e35b38ec539fd8" name="a2986e7ad450928ce89e35b38ec539fd8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2986e7ad450928ce89e35b38ec539fd8">&#9670;&#160;</a></span>setDefaultTimeout() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.setDefaultTimeout </td>
          <td>(</td>
          <td class="paramname"><em>timeout</em>:&#160;</td>
          <td class="paramtype">Duration</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置打开套接字时使用的默认超时 </p>
<p>此方法应在调用 <code><a class="el" href="">open（）</a></code> 之前使用 </p>

</div>
</div>
<a id="aa7c800ada59a901f353dab58758525d6" name="aa7c800ada59a901f353dab58758525d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa7c800ada59a901f353dab58758525d6">&#9670;&#160;</a></span>setDefaultTimeout() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public func commonsNet.DatagramSocketClient.setDefaultTimeout </td>
          <td>(</td>
          <td class="paramname"><em>timeout</em>:&#160;</td>
          <td class="paramtype">Int64</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置打开套接字时使用的默认超时 </p>
<p>此方法应在调用 <code><a class="el" href="">open（）</a></code> 之前使用 </p>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="ac0d2608b3cf17c8a8197a398b349b5b4" name="ac0d2608b3cf17c8a8197a398b349b5b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac0d2608b3cf17c8a8197a398b349b5b4">&#9670;&#160;</a></span>static let DEFAULT_SOCKET_FACTORY</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.DatagramSocketClient.static let DEFAULT_SOCKET_FACTORY : <a class="el" href="classcommonsNet_1_1DefaultDatagramSocketFactory.html">DefaultDatagramSocketFactory</a> = DefaultDatagramSocketFactory.DEFAULT;</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a81cba3257050238fc73f20aadceb4d69" name="a81cba3257050238fc73f20aadceb4d69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81cba3257050238fc73f20aadceb4d69">&#9670;&#160;</a></span>var _isOpen_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.DatagramSocketClient.var _isOpen_ : Bool</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>客户端的套接字当前是否处于打开状态 </p>

</div>
</div>
<a id="ae817188cccd266d039b791da4f839c4d" name="ae817188cccd266d039b791da4f839c4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae817188cccd266d039b791da4f839c4d">&#9670;&#160;</a></span>var _socket_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.DatagramSocketClient.var _socket_ : ?UdpSocket</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>用于连接的数据报套接字 </p>

</div>
</div>
<a id="aae67ef3bfdd385af99f91c034e941bcc" name="aae67ef3bfdd385af99f91c034e941bcc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae67ef3bfdd385af99f91c034e941bcc">&#9670;&#160;</a></span>var _socketFactory_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.DatagramSocketClient.var _socketFactory_ : <a class="el" href="interfacecommonsNet_1_1DatagramSocketFactory.html">DatagramSocketFactory</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>数据报套接字的 DatagramSocketFactory </p>

</div>
</div>
<a id="ac1d6e58d6682ffe35a5d1ddd767f747b" name="ac1d6e58d6682ffe35a5d1ddd767f747b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1d6e58d6682ffe35a5d1ddd767f747b">&#9670;&#160;</a></span>var _timeout_</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">commonsNet.DatagramSocketClient.var _timeout_ : Int64</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>默认超时 </p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/<a class="el" href="datagramsocket__client_8cj.html">datagramsocket_client.cj</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacecommonsNet.html">commonsNet</a></li><li class="navelem"><a class="el" href="classcommonsNet_1_1DatagramSocketClient.html">DatagramSocketClient</a></li>
    <li class="footer">制作者 <img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
